opencode-onboard 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +266 -214
  2. package/content/.agents/agents/basic-engineer.md +30 -0
  3. package/content/.agents/agents/devops-manager.md +38 -29
  4. package/content/.agents/session-log.json +41 -0
  5. package/content/.agents/skills/ob-default/SKILL.md +21 -0
  6. package/content/.agents/skills/ob-generic-guardrails/SKILL.md +32 -0
  7. package/content/.agents/skills/ob-global/SKILL.md +49 -0
  8. package/content/.agents/skills/ob-pullrequest-az/SKILL.md +11 -21
  9. package/content/.agents/skills/ob-pullrequest-gh/SKILL.md +14 -24
  10. package/content/.agents/skills/ob-userstory-az/SKILL.md +8 -14
  11. package/content/.agents/skills/ob-userstory-gh/SKILL.md +6 -14
  12. package/content/.opencode/commands/opsx-apply.md +50 -33
  13. package/content/.opencode/opencode.json +3 -3
  14. package/content/.opencode/plugins/session-log.js +1 -1
  15. package/content/.opencode/skills/openspec-apply-change/SKILL.md +50 -33
  16. package/content/AGENTS.md +95 -141
  17. package/content/skills-lock.json +4 -0
  18. package/package.json +6 -1
  19. package/src/index.js +112 -191
  20. package/src/presets/browser.json +18 -0
  21. package/src/presets/clean.json +21 -0
  22. package/src/presets/models.json +33 -0
  23. package/src/presets/optimization.json +22 -0
  24. package/src/presets/platforms.json +29 -2
  25. package/src/presets/quota.json +14 -0
  26. package/src/presets/source.json +17 -0
  27. package/src/steps/browser/browser.test.js +81 -0
  28. package/src/steps/{install-browser.js → browser/index.js} +12 -15
  29. package/src/steps/{__tests__/clean-ai-files.test.js → clean/clean.test.js} +28 -13
  30. package/src/steps/{clean-ai-files.js → clean/index.js} +32 -30
  31. package/src/steps/{patch-agents-md.js → copy/agents.js} +41 -20
  32. package/src/steps/{__tests__/copy-content.test.js → copy/copy.test.js} +10 -1
  33. package/src/steps/copy/index.js +33 -0
  34. package/src/steps/copy/skills.js +55 -0
  35. package/src/steps/{write-onboard-config.js → metadata/index.js} +3 -3
  36. package/src/steps/metadata/metadata.test.js +96 -0
  37. package/src/steps/models/format.js +60 -0
  38. package/src/steps/models/format.test.js +74 -0
  39. package/src/steps/models/index.js +52 -0
  40. package/src/steps/models/write.js +54 -0
  41. package/src/steps/models/write.test.js +119 -0
  42. package/src/steps/{init-openspec.js → openspec/ensemble.js} +27 -61
  43. package/src/steps/openspec/ensemble.test.js +79 -0
  44. package/src/steps/openspec/index.js +32 -0
  45. package/src/steps/optimization/caveman-guidance.js +11 -0
  46. package/src/steps/{install-caveman.js → optimization/caveman.js} +5 -19
  47. package/src/steps/optimization/global.js +64 -0
  48. package/src/steps/optimization/index.js +101 -0
  49. package/src/steps/{__tests__/token-optimization.test.js → optimization/optimization.test.js} +19 -24
  50. package/src/steps/{install-quota.js → optimization/quota.js} +12 -10
  51. package/src/steps/platform/index.js +81 -0
  52. package/src/steps/platform/platform.test.js +129 -0
  53. package/src/steps/{choose-source-scope.js → source/index.js} +11 -17
  54. package/src/steps/source/source.test.js +89 -0
  55. package/src/utils/__tests__/copy.test.js +12 -5
  56. package/src/utils/copy.js +4 -24
  57. package/src/utils/exec-spinner.js +47 -0
  58. package/src/utils/exec.js +120 -162
  59. package/src/utils/models-cache.js +25 -68
  60. package/src/utils/models-pricing.js +42 -0
  61. package/src/utils/models-pricing.test.js +94 -0
  62. package/content/.agents/agents/back-engineer.md +0 -87
  63. package/content/.agents/agents/front-engineer.md +0 -86
  64. package/content/.agents/agents/infra-engineer.md +0 -85
  65. package/content/.agents/agents/quality-engineer.md +0 -86
  66. package/content/.agents/agents/security-auditor.md +0 -86
  67. package/src/steps/__tests__/check-env.test.js +0 -70
  68. package/src/steps/__tests__/check-platform.test.js +0 -104
  69. package/src/steps/__tests__/check-rtk.test.js +0 -38
  70. package/src/steps/__tests__/choose-platform.test.js +0 -38
  71. package/src/steps/check-env.js +0 -26
  72. package/src/steps/check-platform.js +0 -80
  73. package/src/steps/check-rtk.js +0 -38
  74. package/src/steps/choose-models.js +0 -163
  75. package/src/steps/choose-platform.js +0 -22
  76. package/src/steps/choose-skills-provider.js +0 -79
  77. package/src/steps/copy-content.js +0 -89
  78. package/src/steps/enable-caveman-guidance.js +0 -93
  79. package/src/steps/token-optimization.js +0 -59
package/README.md CHANGED
@@ -1,41 +1,41 @@
1
- <div align="center">
2
-
3
- <img src="https://raw.githubusercontent.com/CKGrafico/opencode-onboard/refs/heads/main/logo.png" alt="opencode-onboard" width="160" />
4
-
5
- # 🧰 opencode-onboard
6
-
7
- **One command to prepare any codebase for AI agent workflows in OpenCode.**
8
-
9
- Works with [OpenCode](https://opencode.ai), [OpenCode Ensemble](https://github.com/hueyexe/opencode-ensemble), [OpenSpec](https://github.com/fission-ai/openspec), GitHub and Azure DevOps.
10
-
11
- [![npm version](https://img.shields.io/npm/v/opencode-onboard?style=flat-square&color=black)](https://www.npmjs.com/package/opencode-onboard)
12
- [![npm downloads](https://img.shields.io/npm/dm/opencode-onboard?style=flat-square&color=black)](https://www.npmjs.com/package/opencode-onboard)
13
- [![license](https://img.shields.io/npm/l/opencode-onboard?style=flat-square&color=black)](./LICENSE)
14
- [![node](https://img.shields.io/node/v/opencode-onboard?style=flat-square&color=black)](https://nodejs.org)
15
-
16
- </div>
17
-
18
- ## What is this?
19
-
20
- Most codebases have no `AGENTS.md`, no architecture docs agents can read, and no defined workflow for picking up tasks. Agents end up improvising, and that produces inconsistent, brittle results.
21
-
22
- **opencode-onboard** fixes that in a single interactive run. It installs a universal and agnostic agent team,but let you choose your own skills, preconfigured your AI models, and initd OpenCode with Openspec and Ensemble.
23
-
24
- <div align="center">
25
- <img src="https://raw.githubusercontent.com/CKGrafico/opencode-onboard/refs/heads/main/demo.gif" alt="opencode-onboard demo" width="700" />
26
- </div>
27
-
28
- ## Quick start
29
-
30
- ```bash
31
- npx opencode-onboard@latest
32
- ```
33
-
1
+ <div align="center">
2
+
3
+ <img src="https://raw.githubusercontent.com/CKGrafico/opencode-onboard/refs/heads/main/logo.png" alt="opencode-onboard" width="160" />
4
+
5
+ # 🧰 opencode-onboard
6
+
7
+ **One command to prepare any codebase for AI agent workflows in OpenCode.**
8
+
9
+ Works with [OpenCode](https://opencode.ai), [OpenCode Ensemble](https://github.com/hueyexe/opencode-ensemble), [OpenSpec](https://github.com/fission-ai/openspec), GitHub and Azure DevOps.
10
+
11
+ [![npm version](https://img.shields.io/npm/v/opencode-onboard?style=flat-square&color=black)](https://www.npmjs.com/package/opencode-onboard)
12
+ [![npm downloads](https://img.shields.io/npm/dm/opencode-onboard?style=flat-square&color=black)](https://www.npmjs.com/package/opencode-onboard)
13
+ [![license](https://img.shields.io/npm/l/opencode-onboard?style=flat-square&color=black)](./LICENSE)
14
+ [![node](https://img.shields.io/node/v/opencode-onboard?style=flat-square&color=black)](https://nodejs.org)
15
+
16
+ </div>
17
+
18
+ ## What is this?
19
+
20
+ Most codebases have no `AGENTS.md`, no architecture docs agents can read, and no defined workflow for picking up tasks. Agents end up improvising, and that produces inconsistent, brittle results.
21
+
22
+ **opencode-onboard** fixes that in a single interactive run. It installs a universal and agnostic agent team,but let you choose your own skills, preconfigured your AI models, and initd OpenCode with Openspec and Ensemble.
23
+
24
+ <div align="center">
25
+ <img src="https://raw.githubusercontent.com/CKGrafico/opencode-onboard/refs/heads/main/demo.gif" alt="opencode-onboard demo" width="700" />
26
+ </div>
27
+
28
+ ## Quick start
29
+
30
+ ```bash
31
+ npx opencode-onboard@latest
32
+ ```
33
+
34
34
  Requires **Node.js 18+**.
35
35
 
36
36
  ### Run specific steps
37
37
 
38
- You can also run individual maintenance/setup steps without the full wizard:
38
+ You can run individual setup/maintenance steps without running the full wizard:
39
39
 
40
40
  ```bash
41
41
  # Run one step directly
@@ -43,7 +43,6 @@ npx opencode-onboard clean
43
43
  npx opencode-onboard platform
44
44
  npx opencode-onboard copy
45
45
  npx opencode-onboard openspec
46
- npx opencode-onboard skills
47
46
  npx opencode-onboard models
48
47
  npx opencode-onboard optimization
49
48
  npx opencode-onboard browser
@@ -55,183 +54,236 @@ npx opencode-onboard -h
55
54
  ```
56
55
 
57
56
  When available, step commands reuse context from `.opencode/opencode-onboard.json`.
58
-
59
- ---
60
-
61
- ## How it works
62
-
63
- The CLI clears the screen, shows a welcome banner, and walks you through 12 steps. The screen always shows the last 2 completed steps + the current one so you always know where you are.
64
-
65
- | Step | What happens |
66
- |------|-------------|
67
- | **1. Environment check** | Verifies Node.js ≥ 18 and pnpm are available |
68
- | **2. Clean AI files** | Detects existing `AGENTS.md`, `.cursorrules`, `CLAUDE.md`, `.agents/` etc. and removes them, preserves your `.agents/skills/` |
69
- | **3. Choose platform** | GitHub or Azure DevOps |
70
- | **4. Check platform CLI** | Verifies `gh` (GitHub) or `az` + `azure-devops` (Azure DevOps) |
71
- | **5. Copy scaffolding** | Drops agents, skills, and bootstrap docs into your project |
72
- | **6. Init OpenSpec** | Runs `npx @fission-ai/openspec init` silently for structured change management |
73
- | **7. Install skills** | Installs built-in `ob-` skills + optional additional skills provider |
74
- | **8. Choose models** | Fetches live model list from [models.dev](https://models.dev), lets you pick plan / build / fast models with cost indicators and canonical pricing |
75
- | **9. Token optimization tools** | Optional (recommended). One checklist step for RTK check, opencode-quota setup, and caveman install (all preselected) |
76
- | **10. Install browser plugin** | Installs `@different-ai/opencode-browser` globally for agent browser automation |
77
- | **11. Write onboarding metadata** | Writes `.opencode/opencode-onboard.json` with selected setup details |
78
-
79
- When it finishes, open OpenCode in your project and type:
80
-
81
- ```
82
- init
83
- ```
84
-
85
- OpenCode generates `ARCHITECTURE.md` and `DESIGN.md` from your actual codebase, then activates the full agent team.
86
-
87
- ---
88
-
89
- ## Agents and Skills
90
-
91
- opencode-onboard draws a hard line between two concepts:
92
-
93
- ### Agents, universal behaviors
94
-
95
- Agents define *how to work*. They are behavioral personas, the same for every project, every tech stack, every team. You never configure them or choose between them. All six are always installed.
96
-
97
- ```
98
- devops-manager reads work items, creates PRs, handles review feedback
99
- front-engineer web, mobile, UI, anything visual
100
- back-engineer APIs, services, data, AI, anything not UI
101
- infra-engineer Terraform, pipelines, cloud infrastructure
102
- quality-engineer unit, integration, e2e tests across all layers
103
- security-auditor vulnerability audit, secrets, auth gaps
104
- ```
105
-
106
- Each agent has a color in the OpenCode UI. Builder agents (`front-engineer`, `back-engineer`, `infra-engineer`) run at `temperature: 0.2` for deterministic output. `security-auditor` is read-only, edit is denied.
107
-
108
- ### Skills, platform knowledge
109
-
110
- Skills define *what to know*. They provide the tech and platform-specific knowledge agents need. Agents detect and load relevant skills automatically, **you never tell an agent which skill to use**.
111
-
112
- Built-in skills (`ob-` prefix) shipped with opencode-onboard:
113
-
114
- | Skill | Purpose |
115
- |-------|---------|
116
- | `ob-userstory-gh` | Parse a GitHub Issue URL into a structured work item |
117
- | `ob-userstory-az` | Parse an Azure DevOps work item URL |
118
- | `browser-automation` | Browser control via `@different-ai/opencode-browser` |
119
-
120
- Skills live in `.agents/skills/`. Any `SKILL.md` file in a subdirectory is automatically discoverable, write your own and agents will pick them up.
121
-
122
- ### Models, plan / build / fast
123
-
124
- During onboarding you pick three models:
125
-
126
- | Role | Used by | Pick |
127
- |------|---------|------|
128
- | **plan** | Main OpenCode session | Something capable with strong reasoning |
129
- | **build** | All builder agents | Something capable for implementation |
130
- | **fast** | `devops-manager` | Something fast and cheap |
131
-
132
- Models are fetched live from [models.dev](https://models.dev) (3000+ models, cached weekly). Cost tiers `[$]` `[$$]` `[$$$]` always reflect the canonical provider price, so `github-copilot/claude-opus-4.7` shows `[$$]` not `[$]`.
133
-
134
- ---
135
-
136
- ## The pipeline
137
-
138
- When you give the lead agent a work item URL, it runs the full pipeline automatically:
139
-
140
- ```
141
- devops-manager → parse work item via skill → structured summary
142
-
143
- openspec-propose
144
- proposal + specs + tasks
145
-
146
- [confirm with user]
147
-
148
- front-engineer + back-engineer + infra-engineer (parallel)
149
-
150
- quality-engineer
151
- tests, build, lint, acceptance
152
-
153
- security-auditor
154
- vulnerabilities, secrets
155
-
156
- devops-manager → screenshots → commit → push → PR → comment
157
- ```
158
-
159
- Each agent runs in its own isolated git worktree via [OpenCode Ensemble](https://github.com/hueyexe/opencode-ensemble), with a live dashboard at `http://localhost:4747`.
160
-
161
- ---
162
-
163
- ## What gets installed
164
-
165
- ```
166
- your-project/
167
- ├── AGENTS.md ← bootstrap mode, replaced after first "init"
168
- ├── ARCHITECTURE.md ← prompt for agents to fill in from your codebase
169
- ├── DESIGN.md ← prompt for agents to fill in from your codebase
170
- ├── .opencode/
171
- │ └── opencode.json ← plan model + plugins configured
172
- └── .agents/
173
- ├── agents/
174
- │ ├── devops-manager.md
175
- │ ├── front-engineer.md
176
- │ ├── back-engineer.md
177
- │ ├── infra-engineer.md
178
- │ ├── quality-engineer.md
179
- │ └── security-auditor.md
180
- └── skills/
181
- ├── browser-automation/
182
- ├── ob-userstory-gh/ ← or -az, depending on platform
183
- └── ob-userstory-az/
184
- ```
185
-
186
- ---
187
-
188
- ## The bootstrap sequence
189
-
190
- The first time you type `init` in OpenCode after onboarding:
191
-
192
- 1. OpenCode reads your codebase and writes a real `ARCHITECTURE.md`
193
- 2. OpenCode reads your design patterns and writes a real `DESIGN.md`
194
- 3. `AGENTS.md` is replaced by the production version
195
- 4. Your agent team is live
196
-
197
- After this, every agent has accurate, persistent context about your project, no manual documentation required.
198
-
199
- ---
200
-
201
- ## Prerequisites
202
-
203
- | Requirement | Notes |
204
- |-------------|-------|
205
- | **Node.js 18+** | Required |
206
- | **[OpenCode](https://opencode.ai)** | The agent runtime |
207
- | **[OpenCode Ensemble](https://github.com/hueyexe/opencode-ensemble)** | Multi-agent parallel execution |
57
+
58
+ Typical flow for reruns:
59
+ - Run `clean` if you want to reset old AI files
60
+ - Run `copy` if templates/skills changed in a new onboard release
61
+ - Run `optimization` if you want to reconfigure RTK/quota/caveman + `ob-global`
62
+ - Run `metadata` last to refresh `.opencode/opencode-onboard.json`
63
+
64
+ ---
65
+
66
+ ## How it works
67
+
68
+ The CLI runs a 10-step onboarding wizard. It keeps the current step visible, plus the last two completed steps, so progress is always clear.
69
+
70
+ | Step | What happens |
71
+ |------|-------------|
72
+ | **1. Source scope** | Choose current repo or sibling source roots for code analysis |
73
+ | **2. Clean AI files** | Detects existing `AGENTS.md`, `.cursorrules`, `CLAUDE.md`, `.agents/` etc. and removes them, preserves your `.agents/skills/` |
74
+ | **3. Choose platform** | GitHub or Azure DevOps |
75
+ | **4. Check platform CLI** | Verifies `gh` (GitHub) or `az` + `azure-devops` (Azure DevOps) |
76
+ | **5. Copy scaffolding** | Copies agents + built-in skills + bootstrap docs, writes source-roots metadata, applies AGENTS bootstrap patching, copies `skills-lock.json`, then runs `npx skills` |
77
+ | **6. Init OpenSpec** | Runs `npx @fission-ai/openspec init` silently for structured change management |
78
+ | **7. Choose models** | Fetches live model list from [models.dev](https://models.dev), lets you pick plan / build / fast models with cost indicators and canonical pricing |
79
+ | **8. Token optimization tools** | Optional (recommended). One checklist step for RTK check, opencode-quota setup, caveman install, and dynamic `ob-global` token-optimization rule injection |
80
+ | **9. Install browser plugin** | Installs `@different-ai/opencode-browser` globally for agent browser automation |
81
+ | **10. Write onboarding metadata** | Writes `.opencode/opencode-onboard.json` with selected setup details |
82
+
83
+ When it finishes, open OpenCode in your project and type:
84
+
85
+ ```
86
+ init
87
+ ```
88
+
89
+ OpenCode generates `ARCHITECTURE.md` and `DESIGN.md` from your actual codebase, then activates the full agent team.
90
+
91
+ ---
92
+
93
+ ## Agents and Skills
94
+
95
+ opencode-onboard draws a hard line between two concepts:
96
+
97
+ ### Agents, universal behaviors
98
+
99
+ Agents define *how to work*. They are universal personas (same behavior across projects and stacks).
100
+
101
+ Current baseline uses a generic execution model:
102
+
103
+ ```
104
+ devops-manager lead/orchestrator, planning, PR lifecycle
105
+ basic-engineer implementation worker, ability-driven
106
+ ```
107
+
108
+ `basic-engineer` behavior is composed by abilities, not hardcoded role silos.
109
+
110
+ ### Skills, platform knowledge
111
+
112
+ Skills define *what to know*. They provide project rules, platform behavior, and task-specific execution guidance. Agents auto-detect/load relevant skills; **you do not manually choose skills per prompt**.
113
+
114
+ Current loading model:
115
+ - `ob-global` is baseline and should be loaded first
116
+ - `ob-default` is fallback when nothing else matches
117
+ - `ob-generic-guardrails` is a minimal base users can extend with custom guardrail skills
118
+
119
+ Default `basic-engineer` abilities:
120
+
121
+ ```
122
+ ## Abilities
123
+ - Guardrails: @ob-generic-guardrails, @ob-default
124
+ - Development: @ob-default
125
+ - Testing: @ob-default
126
+ - Infrastructure: @ob-default
127
+ ```
128
+
129
+ Users are expected to create additional skills and map them into abilities over time.
130
+
131
+ Built-in skills (`ob-` prefix) shipped with opencode-onboard:
132
+
133
+ | Skill | Purpose |
134
+ |-------|---------|
135
+ | `ob-global` | Baseline skill loaded first: context rules, source-roots scope, git/secrets guardrails, token-optimization rules |
136
+ | `ob-default` | Fallback, when no other skill matches. Still loads ob-global first |
137
+ | `ob-generic-guardrails` | Foundation for user guardrails skills |
138
+ | `ob-userstory-gh` | Parse a GitHub Issue URL into a structured work item |
139
+ | `ob-userstory-az` | Parse an Azure DevOps work item URL |
140
+ | `browser-automation` | Browser control via `@different-ai/opencode-browser` |
141
+
142
+ Skills live in `.agents/skills/`. Any `SKILL.md` file in a subdirectory is automatically discoverable, write your own and agents will pick them up.
143
+
144
+ ### Models, plan / build / fast
145
+
146
+ During onboarding you pick three models:
147
+
148
+ | Role | Used by | Pick |
149
+ |------|---------|------|
150
+ | **plan** | Main OpenCode session | Something capable with strong reasoning |
151
+ | **build** | All builder agents | Something capable for implementation |
152
+ | **fast** | `devops-manager` | Something fast and cheap |
153
+
154
+ Models are fetched live from [models.dev](https://models.dev) (3000+ models, cached weekly). Cost tiers `[$]` `[$$]` `[$$$]` always reflect the canonical provider price, so `github-copilot/claude-opus-4.7` shows `[$$]` not `[$]`.
155
+
156
+ ---
157
+
158
+ ## The pipeline
159
+
160
+ When you give the lead agent a work item URL, execution follows this pipeline:
161
+
162
+ ```
163
+ devops-manager (load ob-global first)
164
+
165
+ parse work item via userstory skill
166
+
167
+ openspec-propose
168
+ proposal + specs + tasks
169
+
170
+ [confirm with user]
171
+
172
+ basic-engineer + custom-engineer-* (parallel)
173
+ claim tasks → load abilities → implement
174
+
175
+ verify (tests/build/lint as needed)
176
+
177
+ devops-manager (ship mode, if configured)
178
+ commit → push → PR → feedback loop
179
+ ```
180
+
181
+ 1. Load `ob-global` baseline rules
182
+ 2. Load platform userstory skill (`ob-userstory-gh` or `ob-userstory-az`)
183
+ 3. Run `/opsx-propose` to produce `proposal.md`, specs, and `tasks.md`
184
+ 4. Confirm with user before implementation
185
+ 5. Run `/opsx-apply` to orchestrate implementation workers
186
+ 6. Spawn one or more engineers in parallel (`basic-engineer` and/or custom engineers)
187
+ 7. Each engineer claims tasks, loads relevant abilities, and executes
188
+ 8. Verify with tests/build/lint according to task scope
189
+ 9. Ship/update PR via devops-manager flow
190
+
191
+ Each agent runs in its own isolated git worktree via [OpenCode Ensemble](https://github.com/hueyexe/opencode-ensemble), with a live dashboard at `http://localhost:4747`.
192
+
193
+ ---
194
+
195
+ ## What gets installed
196
+
197
+ ```
198
+ your-project/
199
+ ├── AGENTS.md ← bootstrap mode, replaced after first "init"
200
+ ├── ARCHITECTURE.md ← prompt for agents to fill in from your codebase
201
+ ├── DESIGN.md ← prompt for agents to fill in from your codebase
202
+ ├── .opencode/
203
+ │ ├── opencode.json ← default model + plugin config
204
+ │ ├── ensemble.json ← model assignments for plan/build/fast roles
205
+ │ └── opencode-onboard.json ← onboarding metadata snapshot
206
+ └── .agents/
207
+ ├── agents/
208
+ │ ├── devops-manager.md
209
+ │ └── basic-engineer.md
210
+ └── skills/
211
+ ├── ob-global/ ← baseline skill, load FIRST
212
+ ├── ob-default/ ← fallback skill
213
+ ├── ob-generic-guardrails/ ← foundation for user guardrails
214
+ ├── ob-userstory-gh/ ← or -az, depending on platform
215
+ ├── ob-userstory-az/
216
+ └── browser-automation/
217
+ ```
218
+
219
+ `ob-global` is the baseline skill template. During onboarding, source-roots and token-optimization sections are injected into that template.
220
+
221
+ ---
222
+
223
+ ## The bootstrap sequence
224
+
225
+ The first time you type `init` in OpenCode after onboarding:
226
+
227
+ 1. Bootstrap-mode `AGENTS.md` triggers the initialization workflow
228
+ 2. OpenCode archives existing project context into OpenSpec (`project-history`)
229
+ 3. OpenCode generates real `DESIGN.md` and `ARCHITECTURE.md` from your codebase
230
+ 4. Bootstrap `AGENTS.md` is replaced with production guidance
231
+ 5. Team workflows become fully active for normal implementation tasks
232
+
233
+ After this, every agent has accurate, persistent context about your project, no manual documentation required.
234
+
235
+ ---
236
+
237
+ ## Prerequisites
238
+
239
+ | Requirement | Notes |
240
+ |-------------|-------|
241
+ | **Node.js 18+** | Required |
242
+ | **[OpenCode](https://opencode.ai)** | The agent runtime |
243
+ | **[OpenCode Ensemble](https://github.com/hueyexe/opencode-ensemble)** | Multi-agent parallel execution |
208
244
  | **[rtk](https://github.com/rtk-ai/rtk#pre-built-binaries)** | Recommended for safer agent CLI command execution |
209
- | **[gh CLI](https://cli.github.com)** | GitHub platform, must be authenticated |
210
- | **[az CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)** + azure-devops extension | Azure DevOps platform |
211
-
212
- ---
213
-
214
- ## Development
215
-
216
- ```bash
217
- git clone https://github.com/ckgrafico/opencode-onboard.git
218
- cd opencode-onboard
219
- pnpm install
220
-
221
- # Run the CLI locally
222
- node src/index.js
223
-
224
- # Run tests
225
- pnpm test
226
-
227
- # Watch mode
228
- pnpm test:watch
229
- ```
230
-
231
- Tests are written with [Vitest](https://vitest.dev).
232
-
233
- ---
234
-
235
- ## License
236
-
237
- MIT © [ckgrafico](https://github.com/ckgrafico)
245
+ | **[gh CLI](https://cli.github.com)** | GitHub platform, must be authenticated |
246
+ | **[az CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)** + azure-devops extension | Azure DevOps platform |
247
+
248
+ ---
249
+
250
+ ## Development
251
+
252
+ Wizard choices and defaults live in `src/presets/` where possible:
253
+
254
+ - `source.json` controls source-scope prompt options
255
+ - `platforms.json` controls platform labels and CLI checks
256
+ - `clean.json` controls AI file detection and preservation
257
+ - `models.json` controls model role prompts and agent assignments
258
+ - `optimization.json` controls RTK/quota/caveman checklist defaults
259
+ - `quota.json` controls opencode-quota defaults
260
+ - `browser.json` controls opencode-browser installer automation
261
+
262
+ ```bash
263
+ git clone https://github.com/ckgrafico/opencode-onboard.git
264
+ cd opencode-onboard
265
+ pnpm install
266
+
267
+ # Run the CLI locally
268
+ node src/index.js
269
+
270
+ # Run tests
271
+ pnpm test
272
+
273
+ # Run linting
274
+ pnpm lint
275
+
276
+ # Fix auto-fixable lint issues
277
+ pnpm lint:fix
278
+
279
+ # Watch mode
280
+ pnpm test:watch
281
+ ```
282
+
283
+ Tests are written with [Vitest](https://vitest.dev). Linting uses ESLint flat config with Node ESM defaults and stricter correctness rules.
284
+
285
+ ---
286
+
287
+ ## License
288
+
289
+ MIT © [ckgrafico](https://github.com/ckgrafico)
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Basic Engineer Agent.
3
+ mode: subagent
4
+ color: #68A063
5
+ temperature: 0.2
6
+ permission:
7
+ edit: allow
8
+ bash: allow
9
+ read: allow
10
+ glob: allow
11
+ grep: allow
12
+ ---
13
+
14
+ ## Abilities
15
+ - Guardrails: @ob-generic-guardrails, @ob-default
16
+ - Development: @ob-default
17
+ - Testing: @ob-default
18
+ - Infrastructure: @ob-default
19
+
20
+ ## Workflow
21
+
22
+ When spawned by the lead:
23
+ 1. Call `team_tasks_list` and verify your assigned task IDs and status before starting.
24
+ 2. For each assigned task, call `team_claim task_id:<id>` before any implementation work.
25
+ 3. Load `@ob-global` first, then load mandatory ability `Guardrails`.
26
+ 4. Load additional abilities from the `## Abilities` section as needed for the claimed task domain (for example: development, testing, infrastructure). Each ability can include one or more skills; load all relevant skills listed under each selected ability.
27
+ 5. Send a short `team_message` to lead confirming claimed task ID and loaded skills.
28
+ 6. Implement the task following all loaded skill rules.
29
+ 7. Call `team_tasks_complete task_id:<id>` after finishing that task.
30
+ 8. Repeat until all assigned tasks are completed or blocked, then send final results to lead via `team_message`.
@@ -19,30 +19,28 @@ Process agent, reads work items, creates PRs, handles review feedback. Bookends
19
19
 
20
20
  Work item and issue reading, PR creation, PR comment reading and classification, PR updates, screenshot capture of local running app, branch verification. Does not write application code. Platform knowledge (GitHub, Azure DevOps, etc.) comes entirely from loaded skills.
21
21
 
22
- ## RTK, MANDATORY
22
+ ## Skills and Platform Resolution
23
23
 
24
- Use `rtk` for ALL CLI commands. Never run commands directly.
24
+ Skills are located in `.agents/skills/`. Load required skills explicitly from context and onboarding metadata.
25
25
 
26
- - `rtk gh pr create` NOT `gh pr create`
27
- - `rtk az repos pr create` NOT `az repos pr create`
28
- - `rtk git push` NOT `git push`
26
+ Always load `@ob-global` FIRST before any other skill.
29
27
 
30
- If `rtk` is not available, report it as a blocker. Do not run commands without it.
31
-
32
- ## Skills, Auto-Detection
33
-
34
- Skills are located in `.agents/skills/`. Detect and use relevant skills automatically, the user will never tell you which skill to use.
28
+ Platform skill selection must follow onboarding platform choice from CLI step:
29
+ <!-- OB-PLATFORM-SKILLS-START -->
30
+ - Platform-specific skill instructions are injected during onboarding copy step.
31
+ <!-- OB-PLATFORM-SKILLS-END -->
35
32
 
36
33
  1. If the spawn prompt lists specific skills to load, read those `SKILL.md` files FIRST before any implementation
37
34
  2. Additionally, identify the platform from URLs or context
38
35
 
39
36
  Examples of intent → skill mapping:
40
- - URL contains `dev.azure.com` or `visualstudio.com` look for `ob-userstory-az` or `ob-pullrequest-az`
41
- - URL contains `github.com`look for `ob-userstory-gh` or `ob-pullrequest-gh`
42
- - "create PR" or "ship" → look for a pullrequest skill matching the platform
43
- - "PR has comments" or "review feedback" look for a pullrequest observer skill
37
+ - "read issue/work item"load platform userstory skill
38
+ - "create PR" or "ship" load platform pullrequest skill
39
+ - "PR has comments" or "review feedback" → load platform pullrequest observer skill
40
+ - URL-based platform inference is fallback-only when onboarding metadata is unavailable
44
41
 
45
42
  Rules:
43
+ - Platform selected in onboarding metadata takes precedence over URL inference when both exist
46
44
  - Never interact with a platform without loading the matching skill first
47
45
  - Follow skill instructions exactly, do not partially apply them
48
46
  - If no skill exists for the platform, report it as a blocker rather than improvising
@@ -51,25 +49,36 @@ Rules:
51
49
  ## Two Modes
52
50
 
53
51
  ### Read Mode (pipeline start)
54
- 1. Identify the platform from the URL
55
- 2. Load the matching userstory skill
56
- 3. Fetch and parse the work item
57
- 4. Output structured summary for the lead
52
+ 1. Load `@ob-global` first
53
+ 2. Resolve platform from `.opencode/opencode-onboard.json` (`wizard.platform`) when available; fallback to URL inference only if missing/ambiguous
54
+ 3. Load the matching userstory skill for that resolved platform
55
+ 4. Fetch and parse the work item
56
+ 5. Output structured summary for the lead
58
57
 
59
58
  ### Ship Mode (pipeline end)
60
- 1. Verify all changes are on a feature branch, never `main`
61
- 2. Load the matching pullrequest skill
62
- 3. Capture screenshots of local running app if UI changes exist
63
- 4. Read `.agents/session-log.json` if it exists, parse the JSON array and include a "Session Activity" section in the PR description with agent names, task counts, and skills used
64
- 5. Commit and push the feature branch
65
- 6. Create the PR following the skill instructions
66
- 7. Post PR comment with screenshots and change summary
67
- 8. Report PR URL to the lead
59
+ 1. Load `@ob-global` first
60
+ 2. Verify all changes are on a feature branch, never `main`
61
+ 3. Resolve platform from `.opencode/opencode-onboard.json` (`wizard.platform`) when available; fallback to URL inference only if missing/ambiguous
62
+ 4. Load the matching pullrequest skill for that resolved platform
63
+ 5. Capture screenshots of local running app if UI changes exist
64
+ 6. Read `.agents/session-log.json` if it exists, parse the JSON array and include a "Session Activity" section in the PR description with agent names, task counts, and skills used
65
+ 7. Commit and push the feature branch. If `## Source Roots` lists multiple roots, each root is a separate git repository, create and push the feature branch in EACH repo that has changes; never assume a single repo
66
+ 8. Create the PR following the skill instructions (one PR per repo that has changes)
67
+ 9. Post PR comment with screenshots and change summary
68
+ 10. Report PR URL to the lead
68
69
 
69
70
  ### Feedback Mode (PR review loop)
70
- 1. Load the matching pullrequest observer skill
71
- 2. Read and classify all PR comments
72
- 3. Report classified feedback to the lead, do not implement fixes
71
+ 1. Load `@ob-global` first
72
+ 2. Resolve platform from `.opencode/opencode-onboard.json` (`wizard.platform`) when available; fallback to URL inference only if missing/ambiguous
73
+ 3. Load the matching pullrequest observer skill for that resolved platform
74
+ 4. Read and classify all PR comments
75
+ 5. Report classified feedback to the lead, do not implement fixes
76
+
77
+ ## Worker Model Coordination
78
+
79
+ - Implementation is performed by `basic-engineer` and/or user-defined custom engineers.
80
+ - Multiple engineer workers can run in parallel when task dependencies allow.
81
+ - DevOps Manager orchestrates process, routing, and shipping; it does not implement application code.
73
82
 
74
83
  ## Constraints
75
84